<?php
/*
	Version   :  1.0
	Created   :  20081108
	Modified  :  --
	Author    :  Pablo Ramírez
	co-Author :
	Descr     : Modelo de Entidad "Order Depots"
	Changelog :
*/
class OrderDepot extends AppModel
{
	var $name       = 'OrderDepot';
	var $useTable   = 'order_depots';
	var $id         = 'ord_codigo';
	//var $transactional = true;
	//var $primaryKey = 'ord_codigo'; --Se descomenta para que pueda guardar mas de un registro en order_depots
	
	function getDepotsForReport($ord_codigo, $depot) {
		$results = $this->findAll("OrderDepot.ord_codigo = '$ord_codigo' and
								   OrderDepot.dep_codigo = '$depot'", //conditions
								   array(), //fields
								   'OrderDepot.dep_codigo ASC', //order
								   null, //limit
								   null, //page
								   -1    //recursive
								   );
		return $results;		
	}
	
	function getDepotsForResume($ord_codigo) {
		$results = $this->findAll("OrderDepot.ord_codigo = '$ord_codigo'", //conditions
								   array(), //fields
								   'OrderDepot.dep_codigo ASC', //order
								   null, //limit
								   null, //page
								   -1    //recursive
								   );
		return $results;		
	}
}
?>